﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace sapphirelang.AST.Exprs
{
    // if cond then tbranch [else fbranch]
    // an expr, not a stmt, so that we can use it anywhere
    class IfExpr : Expr
    {
        public Expr cond;
        public Expr tbranch;
        public Expr fbranch;

        public IfExpr(Expr cond, Expr tbranch, Expr fbranch)
        {
            this.cond = cond;
            this.tbranch = tbranch;
            this.fbranch = fbranch;
        }
        public IfExpr(Expr cond, Expr tbranch)
        {
            this.cond = cond;
            this.tbranch = tbranch;
        }
    }
}
